<?php
/**
 * Created by zengwei.
 * Date: 2019/10/10
 * Time: 13:54
 * Function:
 */

namespace App\Common;


class Common
{
    public static function dataFormat($msg='success',$data=null,$code=0){
        return [
          'msg'=>$msg,
          'data'=>$data,
          'code'=>$code,
          'time'=>time(),
        ];
    }

    public static function successDataFormat($msg='success',$data=null){
        return static::dataFormat($msg,$data,0);
    }

    public static function failDataFormat($msg='fail',$data=null){
        return static::dataFormat($msg,$data,1);
    }

}
